<script>
	export default {
		globalData: {
			navigator: {
				navigatorBarHeight: 0,
				statusBarHeight: 0,
				menuButtonHeight: 0,
			}
		},
		onLaunch: function() {
			wx.cloud.init({
				env: 'youth-venture-4g1srxjb142c193c',
				traceUser: true
			})
			const {
				statusBarHeight,
				platform
			} = uni.getSystemInfoSync(); // 获取手机系统状态栏高度
			const {
				top,
				height
			} = uni.getMenuButtonBoundingClientRect(); // 获取按钮top值和高度
			this.globalData.navigator.statusBarHeight = statusBarHeight;
			this.globalData.navigator.menuButtonHeight = height;
			if (top && top !== 0 && height && height !== 0) {
				const navigatorBarHeight = (top - statusBarHeight) * 2 + height;
				this.globalData.navigator.navigatorBarHeight = navigatorBarHeight;
			} else {
				// 按钮高度没获取成功，使用默认高度
				this.globalData.navigator.navigatorBarHeight =
					platform === "android" ? 48 : 40;
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import '@/app.scss';
</style>